<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
</head>
<head>
    <meta charset="utf-8">
    <title>倒计时</title>
</head>
我们期待的2016年还剩下：
<body>
<div id="CountMsg" class="HotDate">
    <span id="t_w">00天</span>
    <span id="t_a">00时</span>
    <span id="t_n">00分</span>
    <span id="t_g">00秒</span>
</div>
<script type="text/javascript">
    function getRTime(){
        var EndTime= new Date('2016/01/01 00:00:00'); //截止时间 
        var NowTime = new Date();
        var t =EndTime.getTime() - NowTime.getTime();
        /*var d=Math.floor(t/1000/60/60/24);
        t-=d*(1000*60*60*24);
        var h=Math.floor(t/1000/60/60);
        t-=h*60*60*1000;
        var m=Math.floor(t/1000/60);
        t-=m*60*1000;
        var s=Math.floor(t/1000);*/

        var w=Math.floor(t/1000/60/60/24);
        var a=Math.floor(t/1000/60/60%24);
        var n=Math.floor(t/1000/60%60);
        var g=Math.floor(t/1000%60);

        document.getElementById("t_w").innerHTML = w + "天";
        document.getElementById("t_a").innerHTML = a + "时";
        document.getElementById("t_n").innerHTML = n + "分";
        document.getElementById("t_g").innerHTML = g + "秒";
    }
    setInterval(getRTime,1000);
    </script>


<body>
	
</body>
</html>